﻿@{
    ViewData["Title"] = "Index";
    Layout = "~/Areas/Console/Views/Shared/_Layout.cshtml";
}
@section head{
    <style type="text/css">
        .layui-table-cell {
            height: 52px;
            line-height: 52px;
        }
    </style>
    <script type="text/javascript">
        var table;
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['table', 'form', 'table', 'laydate', 'upload', 'element'], function () {
            var $ = layui.$
                , form = layui.form
                , admin = layui.admin
                , table = layui.table
                , laydate = layui.laydate
                , upload = layui.upload
                , element = layui.element;

            //日期时间范围
            laydate.render({
                elem: '#addtime'
                , type: 'datetime'
                , range: true
            });

            // 渲染表格
            table.render({
                elem: '#table-datalist'
                , where: { "type": "0" }
                , url: '/Console/Information/GetInfomation'
                , limit: 20
                , title: '案件列表'
                , toolbar: '#table-datalist-toolbar'
                , defaultToolbar: ['filter']
                , cols: [[
                    { field: 'id', title: '编号', hide: true }
                    , {
                        field: 'number', title: '案件信息', width: 400, templet: function (res) {
                            var str = '<span  style="line-height: 25px;display: inline-block;vertical-align: middle;margin-left: 10px;"><p>部门受案号：' + res.number + '</p>'
                            str += '<p>案件名称：' + res.name + '</p>'
                            str += '</span>'
                            return str;
                        }
                    }
                    , {
                        field: 'personname', title: '嫌疑人', width: 350, templet: function (res) {
                            var str = '<span  style="line-height: 25px;display: inline-block;vertical-align: middle;margin-left: 10px;"><p>名称：' + res.personname + '</p>'
                            if (res.idcard != null)
                                str += '<p>证件号码：' + res.idcard + '</p>'
                            str += '</span>'
                            return str;
                        }
                    }
                    , { field: 'cause', title: '移送案由', width: 120 }
                    , { field: 'nature', title: '共同犯罪性质', width: 120 }
                    , { field: 'joinpersonnumber', title: '共同犯罪人数', width: 120 }
                    , { field: 'suspectedcause', title: '涉嫌案由', width: 120 }
                    , { field: 'date', title: '强制措施采取日期', width: 150 }
                    , { field: 'results', title: '审结处理结果', minWidth: 100 }
                    , { field: 'addtime', title: '添加时间', width: 200 }
                    , { field: 'updatetime', title: '最后更新时间', width: 200 }
                    , { fixed: 'right', title: '操作', width: 80, toolbar: '#table-datalist-bar' }
                ]]
                , page: { layout: ['prev', 'page', 'next', 'refresh'] }
            });

            /* 监听提交 */
            form.on('submit(search)', function (data) {
                var params = {};
                params["number"] = $("#number").val();
                params["name"] = $("#name").val();
                params["personname"] = $("#personname").val();
                params["idcard"] = $("#idcard").val();
                params["cause"] = $("#cause").val();
                params["nature"] = $("#nature").val();
                params["suspectedcause"] = $("#suspectedcause").val();
                params["results"] = $("#results").val();
                params["type"] = "0";
                table.reload('table-datalist', {
                    where: params,
                    page: { curr: 1, layout: ['prev', 'page', 'next', 'refresh'] }
                });
                return false;
            });

            //重置
            form.on('submit(reset)', function (data) {
                $('#number').val('')
                $('#name').val('')
                $('#personname').val('')
                $('#idcard').val('')
                $('#cause').val('')
                $('#nature').val('')
                $('#suspectedcause').val('')
                $('#results').val('')
                form.render()
                table.reload('table-datalist', {
                    where: { "type": "0" },
                    page: { curr: 1, layout: ['prev', 'page', 'next', 'refresh'] }
                });
                return false;
            });

        });
    </script>
}
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-card">
                    @*<div class="layui-card-header">条件查询</div>*@
                    <div class="layui-card-body">
                    </div>
                </div>
                <div class="layui-card">
                    @*<div class="layui-card-header">系统用户</div>*@
                    <div class="layui-card-body">
                        <table class="layui-hide" id="table-datalist" lay-filter="table-datalist"></table>
                        <script type="text/html" id="table-datalist-toolbar">
                            <div class="layui-btn-container">
                                    <button class="layui-btn  layui-btn-normal search-btn" lay-submit lay-filter="caseStatistics">线索分析研判</button>
                             <button class="layui-btn  layui-btn-danger search-btn" lay-submit lay-filter="delAll">清空数据</button>
                                </div>
                        </script>
                        <script type="text/html" id="table-datalist-bar">
                            <button class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</button>
                        </script>
                    </div>
                </div>
            </div>
        </div>
    </div>
